#include "datatable.h"

void GameMusic::readline(std::stringstream& _stream)
{
	_stream 
		>> key
		>> music_dir;
}
void GameMusicTable::readline(std::stringstream& _stream)
{
	GameMusic* data = new GameMusic();
	data->readline(_stream);
	_GameMusicList.insert(std::make_pair(data->key, data));
}

void GameEffect::readline(std::stringstream& _stream)
{
	_stream 
		>> key
		>> effect_dir;
}
void GameEffectTable::readline(std::stringstream& _stream)
{
	GameEffect* data = new GameEffect();
	data->readline(_stream);
	_GameEffectList.insert(std::make_pair(data->key, data));
}

void BulletModel::readline(std::stringstream& _stream)
{
	_stream 
		>> key
		>> defaultFrame
		>> speed
		>> netId;
}
void BulletModelTable::readline(std::stringstream& _stream)
{
	BulletModel* data = new BulletModel();
	data->readline(_stream);
	_BulletModelList.insert(std::make_pair(data->key, data));
}

void NetModel::readline(std::stringstream& _stream)
{
	_stream 
		>> key
		>> netActionName
		>> netActionStart
		>> netActionNum
		>> netActionDelay
		>> netDefaultFrame;
}
void NetModelTable::readline(std::stringstream& _stream)
{
	NetModel* data = new NetModel();
	data->readline(_stream);
	_NetModelList.insert(std::make_pair(data->key, data));
}

void CannonModel::readline(std::stringstream& _stream)
{
	_stream 
		>> key
		>> defaultFrame
		>> cannonActionName
		>> cannonActionNum
		>> cannonActionDelay
		>> cannonDefaultFrame;
}
void CannonModelTable::readline(std::stringstream& _stream)
{
	CannonModel* data = new CannonModel();
	data->readline(_stream);
	_CannonModelList.insert(std::make_pair(data->key, data));
}

void FishModel::readline(std::stringstream& _stream)
{
	_stream 
		>> key
		>> modelIndex
		>> fileName
		>> moveAction
		>> moveFrameNum
		>> moveFrameStart
		>> moveDelay
		>> DieAction
		>> DieFrameNum
		>> DieFrameStart
		>> DieDelay
		>> HitAction
		>> HitFrameNum
		>> HitFrameStart
		>> HitDelay
		>> defaultFrame
		>> shapeFile;
}
void FishModelTable::readline(std::stringstream& _stream)
{
	FishModel* data = new FishModel();
	data->readline(_stream);
	_FishModelList.insert(std::make_pair(data->key, data));
}

